package com.maxqaq.service.impl;

import com.maxqaq.constant.MessageConstant;
import com.maxqaq.result.Result;
import com.maxqaq.service.ReportService;
import com.maxqaq.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;


@Service
public class ReportServiceImpl implements ReportService {

    @Autowired
    private UserService userService;

    @Override
    public Result vip(String beginTime, String endTime) {
        List<Map<String, Object>> data = userService.findByTime(beginTime, endTime);
        if (data.size() <= 0) {
            return new Result(false, MessageConstant.REPORT_VIP_EMPTY);
        }
        return new Result(true, MessageConstant.REPORT_VIP_SUCCESS, data);
    }
}
